import os
import sys
import shutil

dirs = os.walk('.')

for i in dirs:

    if '__pycache__' in i[1]:

        shutil.rmtree(os.path.join(i[0],'__pycache__'))